/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.snda.lidejia.hivetotalsort.mr;

import com.snda.lidejia.hivetotalsort.type.HiveSortKey;
import java.io.IOException;
import java.util.Iterator;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapred.MapReduceBase;
import org.apache.hadoop.mapred.OutputCollector;
import org.apache.hadoop.mapred.Reducer;
import org.apache.hadoop.mapred.Reporter;

/**
 *
 * @author lidejia
 */
public class HiveSortReducer extends MapReduceBase implements Reducer<HiveSortKey, Text, NullWritable, Text> {

    public void reduce(HiveSortKey k2, Iterator<Text> itrtr, OutputCollector<NullWritable, Text> oc, Reporter rprtr) throws IOException {
        while (itrtr.hasNext()) {
            oc.collect(NullWritable.get(), itrtr.next());
        }
    }
}
